<?php
/**
 * +----------------------------------------------------------------------
 * | [ DO WHAT YOU LOVE AND FUCK THE REST ]
 * +----------------------------------------------------------------------
 * | EMAIL: < 931274989@qq.com >
 * +----------------------------------------------------------------------
 * | WECHAT: xzc016
 * +----------------------------------------------------------------------
 * | 
 * +----------------------------------------------------------------------
 */
namespace app\admin\service;

use app\admin\model\AuthRule;

class Permissions 
{
  /**
   * 查询所有不验证的方法并放入规则中
   * @return array|\think\response\Json
   * @throws \think\Exception
   */
  public static function auth_opens()
  {
    $authOpen = AuthRule::where('auth_open', '=', '0')
      ->select();
    $authRole = AuthRule::select();
    $authOpens = [];
    foreach ($authOpen as $k => $v) {
      $authOpens[] = $v['id'];
      //查询所有下级权限
      $ids = getChildsRule($authRole, $v['id']);
      foreach ($ids as $kk => $vv) {
        $authOpens[] = $vv['id'];
      }
    }
    $authOpensStr = !empty($authOpens) ? implode(",", $authOpens) : '';
    return $authOpensStr;
  }
 
  
}

?>